//
//  HWLoginViewController.m
//  嗨文
//
//  Created by 响当当 on 2019/3/19.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "HWLoginViewController.h"
#import "HWLoginView.h"

@interface HWLoginViewController ()
@property (nonatomic, strong)HWLoginView *loginView;//登陆
@end

@implementation HWLoginViewController

- (HWLoginView *)loginView
{
    if (!_loginView)
    {
        _loginView = [[HWLoginView alloc]initWithFrame:CGRectMake(0,NAVIBAR_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT-NAVIBAR_HEIGHT)];
        
    }
    return _loginView;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self buryPoint];
    [self setDefaultNav];
    
    [self.view addSubview:self.loginView];
}

- (void)backAction
{
    [self dismissViewControllerAnimated:YES completion:^{
        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
        [appDelegate gotoHome];
    }];
   
}

- (void)buryPoint
{
    NSString *lastStayTime = [kUserDefaults objectForKey:@"time"];
    NSString *nowStayTime = [NSString stringWithFormat:@"%ld",[[HWUtilties getNowTimeTimestamp3] integerValue] - lastStayTime.integerValue];
    
    [HWUtilties buryPointWithStayTime:nowStayTime
                            timestamp:[HWUtilties getNowTimeTimestamp3]
                             memberId:current_User.userID
                              fromUrl:nil
                                toUrl:@"/login"
                               fromId:nil
                                 toId:@"30e77ba53855679c"];
}
@end
